package base 
{
	import display.life.Player;
	import factory.Factory;
	import flash.display.Sprite;
	import manager.InfoCenter;
	import manager.InterfaceManager;
	import manager.ResourceManager;
	import map.WorldMap;
	
	/**
	 * 所有模块类父类
	 * 
	 */
	public class ModuleBase extends Sprite 
	{
		public var data:*;
		public var me:Player;
		public var infoCenter:*;
		public var resLoader:*;
		public var worldMap:WorldMap;
		public var factory:*;
		
		public var moduleWidth:int = -1;
		public var moduleHeight:int = -1;
		
		public function ModuleBase() 
		{
			super();
			
		}
		
		/**
		 * 开启模块
		 */
		public function open():void
		{
			me = Player.Me;
			factory = Factory;
			infoCenter = InfoCenter;
			resManager = ResourceManager;
			worldMap = WorldMap.getInstance;
			trace("this is on stage");
		}
		
		/**
		 * 关闭模块
		 */
		public function close():void
		{
			data = null;
			me = null;
			factory = null;
			worldMap = null;
			infoCenter = null;
			resManager = null;
			InterfaceManager.getInstance.closeModule(true);
			trace("this is out of stage");
		}
	}

}